u32 eax, ebx, ecx, edx;
int index_msb, tmp;
int cpu = smp_processor_id();
+ extern int opt_nosmp;
if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
return;
- cpuid(1, &eax, &ebx, &ecx, &edx);
- smp_num_siblings = (ebx & 0xff0000) >> 16;
+ if (opt_nosmp) {
+ smp_num_siblings = 1;
+ } else {
+ cpuid(1, &eax, &ebx, &ecx, &edx);
+ smp_num_siblings = (ebx & 0xff0000) >> 16;
+ }
if (smp_num_siblings == 1) {
printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
#endif
/* opt_nosmp: If true, secondary processors are ignored. */
-static int opt_nosmp = 0;
+int opt_nosmp = 0;
boolean_param("nosmp", opt_nosmp);
/* maxcpus: maximum number of CPUs to activate. */
struct domain *d, **pd;
struct vcpu *v;
+ ASSERT(cpu_online(cpu));
if ( (d = alloc_domain_struct()) == NULL )
return NULL;
d->domain_id = dom_id;
v->processor = cpu;
-
+
spin_lock_init(&d->big_lock);
spin_lock_init(&d->page_alloc_lock);
/*check whether the awakened task needs to invoke the do_schedule
routine. Try to avoid unnecessary runs but:
Save approximation: Always switch to scheduler!*/
+ ASSERT(d->processor >= 0);
+ ASSERT(d->processor < NR_CPUS);
+ ASSERT(schedule_data[d->processor].curr);
if (should_switch(schedule_data[d->processor].curr, d, now))
cpu_raise_softirq(d->processor, SCHEDULE_SOFTIRQ);
}